<template>
  <el-card>
<el-form ref="form"  label-width="80px">

  <el-form-item label="考试名称:">
    <el-select v-model="shijuanId" placeholder="请选择考试科目" @change="change()">
      <el-option v-for="(item,index) in list" :label="item.name" :value="item.id"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item label="考试时间:">
    <span>60分钟</span>
  </el-form-item>

  <el-form-item>
    <el-button v-if="shijuanId" type="primary" @click="ksxm()">进入考试</el-button>
  </el-form-item>
</el-form>
</el-card>
</template>
<script>
  export default {
    data() {
      return {
				shijuanId:'',
				list:[],
				timu:[]
      }
    },
    methods: {
      ksxm() {
       this.$router.push('/exam/ksym')
      },
	  change(){
		  this.$ajax.post("/Shijuan/chouti",{"id":this.shijuanId}).then(res=>{
			  var result=res.data
			  if(result.success){
				this.timu=result.data
				window.sessionStorage.setItem("timu",JSON.stringify(this.timu))
			  }
		  })
	  }
    },
		created() {
			this.$ajax.post("/Shijuan/list",{}).then(res=>{
				this.list=res.data.data
			})
		}
  }
</script>
